#ifndef PROPERTIES_DIALOG_H
#define PROPERTIES_DIALOG_H

#include <list>
#include <string>
#include <sstream>

#include <Qt\qdialog.h>
#include <Qt\qmessagebox.h>
#include <Qt\qtablewidget.h>
#include <Qt\qtabwidget.h>
#include <Qt\qboxlayout.h>
#include <Qt\qstringlist.h>
#include <Qt\qpushbutton.h>

#include "Properties.h"
#include "MailBoxForm.h"
#include "ConsultantForm.h"
#include "HotelForm.h"

class ResaHotelGUI;

class PropertiesDialog : public QDialog{
	Q_OBJECT

public :
	static const int DIALOG_MIN_WIDTH;

	static const int MAIL_TAB;
	static const int HOTEL_TAB;
	static const int CONS_TAB;

private :
	ResaHotelGUI* parent;

	Properties* properties;
	
	QBoxLayout* generalLayout;

	QTabWidget* tabs;
	QTableWidget* consTable;
	QTableWidget* hotelTable;
	
	QPushButton* addConsultantButton;
	QPushButton* addHotelButton;

	QPushButton* editConsultantButton;
	QPushButton* editHotelButton;

	QPushButton* deleteConsultantButton;
	QPushButton* deleteHotelButton;

	QPushButton* okButton;
	QPushButton* cancelButton;

	MailBoxForm* mailBoxForm;

	PropertiesDialog(void) {}
	PropertiesDialog(const PropertiesDialog&) {}

	void buildMailTab(void);
	void buildConsTab(void);
	void buildHotelTab(void);
	void buildValidationButtons(void);

	void refreshConsTable(void);
	void refreshHotelTable(void);

public :
	PropertiesDialog(ResaHotelGUI* _parent, Properties* _properties);

	virtual ~PropertiesDialog(void){
		//Nothing
	}

	ResaHotelGUI* getParent(void) const { return parent; }

public slots :
	void selectionHandleConsultant(void);
	void selectionHandleHotel(void);

	void addConsultant(void);
	void editConsultant(void);
	void deleteConsultant(void);

	void addHotel(void);
	void editHotel(void);
	void deleteHotel(void);
	
	void validate(void);
	void cancel(void);
};

#endif //PROPERTIES_DIALOG_H